﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace Converter
{
    class OrgLevelToImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                string level = value.ToString();
                switch (level)
                {
                    case "0":
                        return "/Images/orgIcon.png";
                    case "1":
                        return "/Images/secondOrgIcon.png";
                    case "2":
                        return "/Images/thirdOrgIcon.png";
                    case "3":
                        return "/Images/thirdOrgIcon.png";
                    default:
                        return "/Images/thirdOrgIcon.png";
                }

            }
            catch
            {
                return "/SunCreate.Common.Controls;Component/Images/Controls/thirdOrgIcon.png";
            }

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
